/**
 * @author yxw
 * date : 2013年10月15日 下午7:06:14 
 */
package com.tzinfo.tzt.activity;


import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.TextView;

import com.tzinfo.tzt.activity.view.MyProgressDialog;
import com.tzinfo.tzt.config.AppDataConfig;
import com.tzinfo.tzt.R;
import com.yxw.util.OutLog;

public class HouseNewsDetailActivity extends Activity implements OnClickListener{
	private String houseNewId="";
	private String pubTime="";
	
	
	//UI组件
	private Button backBtn;
	private TextView pubTimeText;
	private WebView contentWebView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_news_detail);
		Intent thisIntent=this.getIntent();
		houseNewId=thisIntent.getStringExtra("houseNewsId");
        OutLog.LogE("houseNewsId",houseNewId);
        pubTimeText=(TextView) this.findViewById(R.id.text_news_pub_time);
        if (thisIntent.getStringExtra("pubTime")!=null){
            pubTime=thisIntent.getStringExtra("pubTime");
            pubTimeText.setText(pubTime);
        }
		else {
            pubTimeText.setVisibility(View.GONE);
        }
		init();
		
	}
	
	private void init(){
		contentWebView=(WebView) this.findViewById(R.id.webview_news_content);
		backBtn=(Button) this.findViewById(R.id.bt_back);
		backBtn.setOnClickListener(this);
		//加载数据
		updateUI();
	}
	
	private void updateUI(){
		contentWebView.loadUrl(AppDataConfig.xinfangUrl
					+ AppDataConfig.NewhouseNewsWebView + "?id=" + houseNewId);


	}
	

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.bt_back:
			this.finish();
			break;

		default:
			break;
		}
		
	}
}
